package cn.micro.keep.accounts.entity.dto;

import cn.micro.keep.accounts.util.ValidateGroup;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

@Data
public class AccountOdsRecordDTO {
    /**
     * 账单主键ID
     */
    @NotNull(message = "账单ID不能为空",groups = ValidateGroup.edit.class)
    private Long id;

    /**
     * 项目名称
     */
    @NotEmpty(message = "项目名称不能为空",groups = ValidateGroup.add.class)
    private String projectName;

    /**
     * 账单金额
     */
    @NotNull(message = "账单金额不能为空",groups = ValidateGroup.add.class)
    private BigDecimal amount;

    /**
     * 账单描述
     */
    private String descInfo;

    /**
     * 账单分类ID
     */
    @NotNull(message = "账单分类ID不能为空",groups = ValidateGroup.add.class)
    private Integer categoryId;


    /**
     * 账单日期
     */
    @NotNull(message = "账单日期不能为空",groups = ValidateGroup.add.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate useDate;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 账单分组ID(个人记账都为0)
     */
    private Long groupId;

    /**
     * 备注
     */
    private String remark;

    /**
     * 图片的列表
     */
    private List<Long> imgIds;


}
